<?php

namespace App\Http\Controllers\Admin;

use App\Http\Filters\ReportverifylogFilter;
use App\Models\Reportverifylog;
use App\Http\Requests\ReportverifylogRequest;
use App\Http\Resources\ReportverifylogResource;
use Illuminate\Http\Request;

class ReportverifylogController extends Controller
{
    public function index(ReportverifylogFilter $filter)
    {
        $reportverifylogs = Reportverifylog::query()
            ->with("report")
            ->filter($filter)
            ->paginate();

        return $this->ok(ReportverifylogResource::collection($reportverifylogs));
    }

    public function create()
    {
        return $this->ok();
    }

    public function store(ReportverifylogRequest $request)
    {
        $inputs = $request->validated();
        $reportverifylog = Reportverifylog::create($inputs);

        return $this->created(ReportverifylogResource::make($reportverifylog));
    }

    public function edit(Request $request, Reportverifylog $reportverifylog,$id)
    {
        return $this->ok(ReportverifylogResource::make($reportverifylog));
    }

    public function update(ReportverifylogRequest $request, Reportverifylog $reportverifylog)
    {
        $inputs = $request->validated();
        $reportverifylog->update($inputs);

        return $this->created(ReportverifylogResource::make($reportverifylog));
    }

    public function destroy(Reportverifylog $reportverifylog)
    {
        $reportverifylog->delete();
        return $this->noContent();
    }
}
